package com.shzq.dao;

import com.shzq.pojo.EarthquakeDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@Component
public interface EarthquakeMapper extends Mapper<EarthquakeDO> {
    @Insert("insert into earthquake(occurrenceTime,latitude,depth,strength,address) values(#{occurrenceTime},#{latitude},#{depth},#{strength},#{address})")
    void add(Map map);
    @Update("update earthquake set occurrenceTime = #{date} where id = #{id}")
    void update(Map map);
    @Select("select id from earthquake")
    List<Integer> findAllIds();
}
